Where an array
is declared in the main function it will usually have details of dimensions
included. It is possible to use another type called a pointer in place of an
array. This means that dimensions are not fixed immediately, but space can be
allocated as required. This is an advanced technique which is only required
in certain specialised programs. |
|
Another feature
of arrays is their passing as function arguments. A function can be passed an
array as an argument without knowing the size of the array's final dimension.
So for example if we have a function which inverts a matrix (represented by
an array) then the function will be able to invert matrices of different
sizes. The drawback is that the function is unable to determine what size the
matrix is, so this information will have to be passed as an additional
argument. |
|